package com.trkj.service.lzs;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.trkj.dao.lzs.RecruitapplyDao;
import com.trkj.pojo.Recruitapply;
import com.trkj.pojo.Salary;
import com.trkj.pojo.SocialSecurity;
@Service
public class RecruitapplyService {
	//招聘申请单
	@Autowired 
	private   RecruitapplyDao  recruitapplydao;
	 //查询所有
	public  List<Recruitapply> recruitapplyfindAll(){
	   return (List<Recruitapply>) recruitapplydao.findAll();
		
	}
	//添加
			public void tj(Timestamp reappDemanddate ,String reappExplain,BigDecimal reappPlan) {
				try {
					Recruitapply ab= new Recruitapply();
					ab.setReappPlan(reappPlan);
					ab.setReappExplain(reappExplain);
					ab.setReappDemanddate(reappDemanddate);
					recruitapplydao.save(ab);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			}
			  //编辑  
		     public   void lzs_Edit( long reappId ,Timestamp reappDemanddate ,String reappExplain,BigDecimal reappPlan) {
		    	 Recruitapply edit =recruitapplydao.findOne(reappId);
		    	    edit.setReappExplain(reappExplain);
		    	    edit.setReappPlan(reappPlan);
		    	    edit.setReappDemanddate(reappDemanddate);
		    	    recruitapplydao.save(edit);
		     }
		     
		     public Recruitapply chun1(Long reappId) {
		    	 return recruitapplydao.findOne(reappId);
		 		
		     }
		   //模糊查询
		 	public  List<Recruitapply> queryByName (String  text){

	  			return recruitapplydao.queryByName("%" + text + "%");
	  		}
		     
}
